﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorJob.h
 * @brief 读写HDF5文件的Job类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-06-11
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORJOB_H__
#define  _FITKABAQUSHDF5ADAPTORJOB_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITKAbaqusHDF5AbstractAdaptor.h"

 //前置声明
ForwardDeclarNS(AbaqusData, FITKJob)

namespace IO
{
    /**
     * @brief HDF5 SectionAssign 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-11
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorJob : public FITKAbaqusHDF5AbstractAdaptor
    {
    public:
        explicit FITKAbaqusHDF5AdaptorJob() = default;
        virtual ~FITKAbaqusHDF5AdaptorJob() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptW() override;

    protected:

        /**
         * @brief           读取任务
         * @param           job 任务
         * @param h5Group   数据块
         * @return          状态 true成功， false失败
         * @author          fulipeng (fulipengqd@yeah.net)
         * @date            2024-05-30
         */
        virtual bool readJob(AbaqusData::FITKJob* job, H5::Group& h5Group);

        /**
         * @brief           写出任务
         * @param           job 任务
         * @param h5Group   数据块
         * @return          状态 true成功， false失败
         * @author          fulipeng (fulipengqd@yeah.net)
         * @date            2024-05-30
         */
        virtual bool writeJob(AbaqusData::FITKJob* job, H5::Group& h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, AbaqusData::FITKJob, FITKAbaqusHDF5AdaptorJob)

}

#endif
